//
//  FindOutTVCell.m
//  Logistics
//
//  Created by enzhoukeji on 2018/8/8.
//  Copyright © 2018年 puyue.com. All rights reserved.
//

#import "FindOutTVCell.h"

@implementation FindOutTVCell

/**
 
 BaseTableViewCell
 ) UIImageView *headImage;
) UILabel *titleName;
) UIButton  *telBut;
) UILabel * lengthLable;
) UILabel * typeLabel;
) UILabel * modelLabel;
) UILabel * provenanceLabel;
) UIImageView * jianTouImage;
) UILabel * destinationLabel;
 */
-(void)loadViews {
    self.headImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"touxiangMN"]];
    self.titleName = [UILabel labelWithSize:[UIFont systemFontOfSize:13] withColor:[UIColor blackColor] withText:@"千佛山大佛"];
    self.titleName.textAlignment = NSTextAlignmentCenter;
    self.telBut = [UIButton new];
    [self.telBut setBackgroundImage:[UIImage imageNamed:@"gouwuche"] forState:UIControlStateNormal];
    [self.telBut addTarget:self action:@selector(telButtonC:) forControlEvents:UIControlEventTouchUpInside];
    self.lengthLable = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"18米"];
    self.lengthLable.textAlignment = NSTextAlignmentCenter;
    self.typeLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"厢式/6000KG"];
    self.typeLabel.textAlignment = NSTextAlignmentCenter;
    self.modelLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"百货"];
    self.modelLabel.textAlignment = NSTextAlignmentCenter;
    self.provenanceLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:14] withColor:[UIColor blackColor] withText:@"济南"];
    self.provenanceLabel.textAlignment = NSTextAlignmentCenter;
    self.jianTouImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"jiantou"]];
    
    self.destinationLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:14] withColor:[UIColor blackColor] withText:@"杭州 嘉兴"];
    self.destinationLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.headImage];
    [self addSubview:self.titleName];
    [self addSubview:self.telBut];
    [self addSubview:self.lengthLable];
    [self addSubview:self.typeLabel];
    [self addSubview:self.modelLabel];
    [self addSubview:self.provenanceLabel];
    [self addSubview:self.jianTouImage];
    [self addSubview:self.destinationLabel];
    
}
-(void)layoutViews {
    [self.headImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(15)));
        make.top.equalTo(@(GTFixHeightFlaot(10)));
        make.height.equalTo(@(GTFixHeightFlaot(20)));
        make.width.equalTo(@(GTFixHeightFlaot(20)));
    }];
    [self.titleName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.headImage.mas_right).offset(GTFixWidthFlaot(5));
        make.top.mas_equalTo(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(self.titleName.mas_width);
    }];
    [self.telBut mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.titleName.mas_right).offset(GTFixWidthFlaot(10));
        make.top.mas_equalTo(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(GTFixHeightFlaot(20));
    }];
    [self.lengthLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(15));
        make.top.mas_equalTo(self.headImage.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(self.lengthLable.mas_width);
    }];
    [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.lengthLable.mas_right).offset(GTFixWidthFlaot(10));
        make.top.mas_equalTo(self.headImage.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(self.typeLabel.mas_width);
    }];
    [self.modelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.typeLabel.mas_right).offset(GTFixWidthFlaot(10));
        make.top.mas_equalTo(self.headImage.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(self.modelLabel.mas_width);
    }];
    
    [self.provenanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kMainScreen_width/2 + GTFixWidthFlaot(40));
        make.top.mas_equalTo(GTFixHeightFlaot(5));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(self.provenanceLabel.mas_width);
    }];
    [self.jianTouImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.provenanceLabel.mas_right).offset(GTFixWidthFlaot(3));
        make.top.mas_equalTo(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(10));
        make.width.mas_equalTo(GTFixWidthFlaot(25));
    }];
    
    [self.destinationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.jianTouImage.mas_right).offset(GTFixWidthFlaot(3));
        make.top.mas_equalTo(GTFixHeightFlaot(5));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(self.destinationLabel.mas_width);
    }];
    
    
}
-(void)telButtonC:(UIButton *)btn {
    
}
@end
